var from = getQueryString("_from");
var planData = getQueryString("_data");
var testConfig = require('./testConfig');
var SearchProject = null;
var user = '';

if(from){
  user = from.split('_');
  SearchProject = require(`./${user[0]}/${user[1]}`);
  SearchProject.start();
}else if(planData){
  window.sessionStorage.setItem("runTimes",0);
  window.sessionStorage.setItem("planData",planData);
  testConfig.planData = JSON.parse(planData);
  user = testConfig.planData.cases[0].caseNumber.split('_');
  SearchProject = require(`./${user[0]}/${user[1]}`);
  SearchProject.start();
}
function getQueryString(name) {
  var str = location.search;
  var json = {};
  str = str.slice(1).split('&');
  for (var i = 0; i < str.length; i++) {
    var a = str[i].split('=');
    json[a[0]] = decodeURI(a[1]);
  }
  if (json != null) return json[name];
  return null;
}
